package com.itheima.clientAndService01;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class IOClass01 {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        FileInputStream fis = null;
        FileOutputStream fos = null;
        try {
            fis = new FileInputStream("F:\\study\\就业班\\4.jpg");
            fos = new FileOutputStream("F:\\study\\4.jpg");
            byte[] by = new byte[1024];
            int len;
            while ((len = fis.read(by)) != -1) {
                fos.write(by,0,len);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fis.close();
                fos.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        long end = System.currentTimeMillis();
        System.out.println("程序运行了" + (end - start) + "毫秒");
    }
}
